<?php 
session_start();

header("Content-Type: text/plain;charset=utd-8");
header("Access-Control-Allow-Origin:*");
header("Access-Control-Methods:POST,GET");

require_once("classes/skillFind.php");

//接收前台传送数据
$title = $_POST['title']; //寻求帮助的标题
$editor = $_SESSION['userid']; 
$skilltype = $_POST['skilltype']; //技能类型
$payType = $_POST['payType']; //报酬方式
$content = $_POST['content']; //详细内容
$pay = $_POST['pay']; //报酬设定
$time = $_POST['time']; //时间限制
$phone = $_POST['phone']; //手机号
$qq = $_POST['qq']; //qq号
$datatime = date("Y-m-d H:i:s");

// $title = "title"; //寻求帮助的标题
// $editor = '1';
// $skilltype = 'PS'; //技能类型
// $payType = 'RMB'; //报酬方式
// $content = 'content'; //详细内容
// $pay = '2'; //报酬设定
// $time = '6'; //时间限制
// $phone = '13384116666'; //手机号
// $qq = '11489999'; //qq号
// $datatime = date("Y-m-d H:i:s");

$skillFind = new SkillFind();
$result = $skillFind->insert($title,$editor,$skilltype,$payType,$content,$pay,$time,$phone,$qq,$datatime);

$error = "error";//如果失败则传送
$success = "success";
if(!$result){
	echo json_encode($error,JSON_UNESCAPED_UNICODE);
}else{
	echo json_encode($success,JSON_UNESCAPED_UNICODE);
}


?>